from pathlib import Path
from compare import ReferenceComparer, get_last_two_commits
Find commits to compare¶
By default, the notebook compares last two commits(ref1hash is the older one and ref2hash is the newer one). You can customise this by changing the ref1_hash and ref2_hash variables or by providing REF1_HASH and REF2_HASH commit values. You can also provide custom spectrum paths for the two hashes with respect to the root directory for that commit.
import os
ref1_hash = os.getenv('REF1_HASH')
ref2_hash = os.getenv('REF2_HASH')
if not (ref1_hash and ref2_hash):
ref1_hash, ref2_hash = get_last_two_commits()
if not (ref1_hash and ref2_hash):
raise ValueError("Could not get commit hashes.")
if os.getenv('CUSTOM_REF1_SPECTRUM_PATH'):
custom_ref1_spectrum_path = os.getenv('CUSTOM_REF1_SPECTRUM_PATH')
else:
custom_ref1_spectrum_path = 'tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'
if os.getenv('CUSTOM_REF2_SPECTRUM_PATH'):
custom_ref2_spectrum_path = os.getenv('CUSTOM_REF2_SPECTRUM_PATH')
else:
custom_ref2_spectrum_path = 'tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'
ref1_hash, ref2_hash
('b2fdf418ac1a3631f8c3d2a5f392b6ebfa09ba0b',
'c31d35a1ad0f9b74f4bde010d4ad9c9a4f086fa5')
Example Values¶
Below are example values you can test the notebook with.
# ref1_hash="170f1a2c0d8c6db518a4b9a0f4cb9b657aaa61b6"
# ref2_hash="d9fd3bb659d185bd9ece10b8e2175cf497ea84c5"
# custom_ref1_spectrum_path = 'tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'
# custom_ref2_spectrum_path = 'test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5'
Initialise the ReferenceComparer class¶
comparer = ReferenceComparer(ref1_hash=ref1_hash, ref2_hash=ref2_hash, print_path=True)
comparer.setup()
comparer.diff_analyzer.display_diff_tree(comparer.dcmp)
Created temporary directory at /tmp/ref_compare_lfl0odub
ā .github/ ā ā actions/ ā ā ā setup_env/ ā ā workflows/ ā arepo_data/
ā atom_data/
ā ā nlte_atom_data/
ā ā stardis_atom_data/
ā tardis/ ā ā opacities/ ā ā ā tests/ ā ā ā ā test_tau_sobolev/ ā ā ā ā ā± test_calculate_sobolev_line_opacity.h5 ā ā plasma/ ā ā ā equilibrium/ ā ā ā ā tests/ ā ā ā ā ā test_level_populations/ ā ā ā ā ā ā test_level_population_solver/ ā ā ā ā ā ā ā± test_solve__collisional_rate_solver0-radiative_transitions0__.h5 ā ā ā ā ā test_rate_matrix/ ā ā ā ā ā ā± test_rate_matrix_solver__collisional_rate_solver0-radiative_transitions0__.h5 ā ā ā tests/ ā ā ā ā test_complete_plasmas/ ā ā ā ā ā test_plasma/ ā ā ā ā ā ā± plasma_unittest_disable_electron_scattering_False.h5 ā ā ā ā ā ā± plasma_unittest_disable_electron_scattering_True.h5 ā ā ā ā ā ā± plasma_unittest_excitation_dilute-lte.h5 ā ā ā ā ā ā± plasma_unittest_excitation_lte.h5 ā ā ā ā ā ā± plasma_unittest_helium_treatment_recomb-nlte.h5 ā ā ā ā ā ā± plasma_unittest_helium_treatment_recomb-nlte_delta_treatment_0.5.h5 ā ā ā ā ā ā± plasma_unittest_initial_t_inner_10000 K.h5 ā ā ā ā ā ā± plasma_unittest_initial_t_rad_10000 K.h5 ā ā ā ā ā ā± plasma_unittest_ionization_lte.h5 ā ā ā ā ā ā± plasma_unittest_ionization_nebular.h5 ā ā ā ā ā ā± plasma_unittest_line_interaction_type_downbranch.h5 ā ā ā ā ā ā± plasma_unittest_line_interaction_type_macroatom.h5 ā ā ā ā ā ā± plasma_unittest_line_interaction_type_scatter.h5 ā ā ā ā ā ā± plasma_unittest_nlte.h5 ā ā ā ā ā ā± plasma_unittest_nlte_classical_nebular.h5 ā ā ā ā ā ā± plasma_unittest_nlte_coronal_approximation.h5 ā ā ā ā ā ā± plasma_unittest_radiative_rates_type_blackbody.h5 ā ā ā ā ā ā± plasma_unittest_radiative_rates_type_detailed.h5 ā ā ā ā ā ā± plasma_unittest_radiative_rates_type_detailed_w_epsilon_1e-10.h5 ā ā ā ā ā ā± plasma_unittest_radiative_rates_type_dilute-blackbody.h5 ā ā ā ā test_hdf_plasma/ ā ā ā ā ā± test_hdf_levels.h5 ā ā ā ā test_nlte_excitation/ ā ā ā ā test_nlte_solver/ ā ā ā ā test_plasma_continuum/ ā ā ā ā test_tardis_model_density_config/ ā ā ā ā ā± test_isotope_number_densities.h5 ā ā simulation/ ā ā ā tests/ ā ā ā ā test_simulation/ ā ā ā ā ā± test_plasma_estimates__dilution_factor__.h5 ā ā ā ā ā± test_plasma_estimates__j_estimator__.h5 ā ā ā ā ā± test_plasma_estimates__nu_bar_estimator__.h5 ā ā ā ā ā± test_plasma_estimates__output_energies__.h5 ā ā ā ā ā± test_plasma_estimates__output_nus__.h5 ā ā ā ā ā± test_plasma_estimates__t_radiative__.h5 ā ā ā ā ā± test_plasma_state_iterations__iterations_electron_densities__.h5 ā ā ā ā ā± test_plasma_state_iterations__iterations_t_inner__.h5 ā ā ā ā ā± test_plasma_state_iterations__iterations_t_rad__.h5 ā ā ā ā ā± test_plasma_state_iterations__iterations_w__.h5 ā ā spectrum/ ā ā ā tests/ ā ā ā ā test_spectrum_solver/ ā ā ā ā ā test_spectrum_solver/ ā ā ā ā ā ā± TestSpectrumSolver.h5 ā ā tests/ ā ā ā test_tardis_full/ ā ā ā ā test_transport_simple/ ā ā ā ā ā± TestTransportSimple.h5 ā ā ā test_tardis_full_formal_integral/ ā ā ā ā test_transport_simple_formal_integral/ ā ā ā ā ā± test_simulation__-1-downbranch__.h5 ā ā ā ā ā± test_simulation__-1-macroatom__.h5 ā ā ā ā ā± test_simulation__30-downbranch__.h5 ā ā ā ā ā± test_simulation__30-macroatom__.h5 ā ā ā ā ā± test_spectrum_integrated__-1-downbranch__.npy ā ā ā ā ā± test_spectrum_integrated__-1-macroatom__.npy ā ā ā ā ā± test_spectrum_integrated__30-downbranch__.npy ā ā ā ā ā± test_spectrum_integrated__30-macroatom__.npy ā ā transport/ ā ā ā montecarlo/ ā ā ā ā tests/ ā ā ā ā ā test_continuum/
ā ā ā ā ā test_montecarlo_main_loop/ ā ā ā ā ā ā± test_montecarlo_main_loop.h5 ā ā ā ā ā ā± test_montecarlo_main_loop_vpacket_log.h5 ā ā ā ā ā test_packet_source/ ā ā ā ā ā ā test_black_body_simple_source/ ā ā ā ā ā ā ā± test_bb_attributes.h5 ā ā ā ā ā ā test_black_body_simple_source_rel/ ā ā ā ā ā ā ā± test_bb_attributes.h5 ā ā ā ā ā test_rpacket_tracker/ ā ā ā ā ā test_weighted_packet_source/ ā ā ā ā ā ā test_black_body_weighted_source/ ā ā ā ā ā ā ā± test_bb_attributes.h5 ā ā visualization/ ā ā ā tools/ ā ā ā ā tests/ ā ā ā ā ā test_liv_plot/ ā ā ā ā ā ā test_liv_plotter/ ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl0__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl1__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl2__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl3__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl4__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl5__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl6__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_mpl7__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply0__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply1__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply2__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply3__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply4__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply5__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply6__.h5 ā ā ā ā ā ā ā± test_generate_plot_ply__plotter_generate_plot_ply7__.h5 ā ā ā ā ā test_sdec_plot/ ā ā ā ā ā ā test_sdec_plotter/ ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data0__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data10__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data11__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data12__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data13__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data14__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data15__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data1__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data2__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data3__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data4__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data5__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data6__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data7__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data8__.h5 ā ā ā ā ā ā ā± test_calculate_plotting_data__plotter_calculate_plotting_data9__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply0__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply10__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply11__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply12__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply13__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply14__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply15__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply1__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply2__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply3__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply4__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply5__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply6__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply7__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply8__.h5 ā ā ā ā ā ā ā± test_generate_plot_mpl__plotter_generate_plot_ply9__.h5
comparer.compare()
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file TestTransportSimple.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1e+32 |
| max | 2e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.1e-16 |
| max | 7.9e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full/test_transport_simple Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full/test_transport_simple
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file TestTransportSimple.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.9e+24 |
| max | 3.6e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.7e-16 |
| max | 7.1e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full/test_transport_simple Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full/test_transport_simple
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
================================================== Summary for TestTransportSimple.h5: Total number of keys- in ref1: 93, in ref2: 93 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 90 ================================================== Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__-1-macroatom__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.9e+24 |
| max | 3.6e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.5e-16 |
| max | 6.6e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__-1-macroatom__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.2e+32 |
| max | 2.4e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.9e-16 |
| max | 7.4e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral ================================================== Summary for test_simulation__-1-macroatom__.h5: Total number of keys- in ref1: 24, in ref2: 24 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 22 ================================================== Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__-1-downbranch__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.6e+24 |
| max | 3e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.4e-16 |
| max | 6.5e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__-1-downbranch__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.2e+32 |
| max | 2.4e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.3e-16 |
| max | 8.3e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
================================================== Summary for test_simulation__-1-downbranch__.h5: Total number of keys- in ref1: 24, in ref2: 24 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 22 ==================================================
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__30-macroatom__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.9e+24 |
| max | 3.6e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.7e-16 |
| max | 7e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__30-macroatom__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.2e+32 |
| max | 2.4e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.6e-16 |
| max | 8.7e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
================================================== Summary for test_simulation__30-macroatom__.h5: Total number of keys- in ref1: 24, in ref2: 24 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 22 ==================================================
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity in file test_simulation__30-downbranch__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.9e+24 |
| max | 3.6e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.9e-16 |
| max | 7.4e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
Displaying heatmap for key /simulation_container/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_simulation__30-downbranch__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.2e+32 |
| max | 2.4e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.6e-16 |
| max | 8.7e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/tests/test_tardis_full_formal_integral/test_transport_simple_formal_integral
================================================== Summary for test_simulation__30-downbranch__.h5: Total number of keys- in ref1: 24, in ref2: 24 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 22 ==================================================
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file TestSpectrumSolver.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 6.2e+31 |
| max | 1.2e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.1e-16 |
| max | 7.9e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file TestSpectrumSolver.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.9e+24 |
| max | 3.6e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.2e-16 |
| max | 7.9e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
================================================== Summary for TestSpectrumSolver.h5: Total number of keys- in ref1: 93, in ref2: 93 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 90 ==================================================
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
Error comparing item: /simulation/plasma/yg_interp unsupported operand type(s) for -: 'PchipInterpolator' and 'PchipInterpolator' ================================================== Summary for test_montecarlo_continuum.h5: Total number of keys- in ref1: 148, in ref2: 148 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 146 ==================================================
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_montecarlo_main_loop_vpacket_log.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 6.3e+31 |
| max | 1.2e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.1e-16 |
| max | 7.8e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file test_montecarlo_main_loop_vpacket_log.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.6e+24 |
| max | 3e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.6e-16 |
| max | 6.8e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop Error comparing item: /simulation/plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field'
================================================== Summary for test_montecarlo_main_loop_vpacket_log.h5: Total number of keys- in ref1: 93, in ref2: 93 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 90 ================================================== Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity_density_lambda in file test_montecarlo_main_loop.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 6.3e+31 |
| max | 1.2e+32 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 4.2e-16 |
| max | 8.1e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Displaying heatmap for key /simulation/spectrum_solver/spectrum_integrated/luminosity in file test_montecarlo_main_loop.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 1.2e+24 |
| max | 2.4e+24 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 3.9e-16 |
| max | 7.4e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/transport/montecarlo/tests/test_montecarlo_main_loop Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/transport/montecarlo/tests/test_montecarlo_main_loop
Error comparing item: /simulation/plasma/dilute_planckian_radiation_field No module named 'tardis.plasma.radiation_field' ================================================== Summary for test_montecarlo_main_loop.h5: Total number of keys- in ref1: 83, in ref2: 83 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 2 Number of totally same keys: 80 ==================================================
Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply0__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply0__.h5: Total number of keys- in ref1: 27, in ref2: 27 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 26 ================================================== Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply4__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply4__.h5: Total number of keys- in ref1: 27, in ref2: 27 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 26 ==================================================
Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply5__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply5__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ==================================================
Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply10__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply10__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ================================================== Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply14__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply14__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ==================================================
Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply7__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter
================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply7__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ==================================================
Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply2__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply2__.h5: Total number of keys- in ref1: 27, in ref2: 27 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 26 ==================================================
Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply11__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply11__.h5: Total number of keys- in ref1: 23, in ref2: 23 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 22 ==================================================
Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply3__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply3__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ================================================== Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply13__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply13__.h5: Total number of keys- in ref1: 23, in ref2: 23 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 22 ==================================================
Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply1__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply1__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ================================================== Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply8__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply8__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ==================================================
Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply9__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply9__.h5: Total number of keys- in ref1: 23, in ref2: 23 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 22 ================================================== Displaying heatmap for key /plot_data_hdf/_8y in file test_generate_plot_mpl__plotter_generate_plot_ply15__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply15__.h5: Total number of keys- in ref1: 23, in ref2: 23 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 22 ==================================================
Displaying heatmap for key /plot_data_hdf/_10y in file test_generate_plot_mpl__plotter_generate_plot_ply6__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2e-31 |
| max | 3.9e-31 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply6__.h5: Total number of keys- in ref1: 27, in ref2: 27 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 26 ==================================================
Displaying heatmap for key /plot_data_hdf/_9y in file test_generate_plot_mpl__plotter_generate_plot_ply12__.h5 Visualising Absolute Differences
| Ā | 0 |
|---|---|
| mean | 2.4e+21 |
| max | 4.7e+21 |
Visualising Relative Differences
| Ā | 0 |
|---|---|
| mean | 5.9e-17 |
| max | 1.2e-16 |
Path1: /tmp/ref_compare_lfl0odub/ref1/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter Path2: /tmp/ref_compare_lfl0odub/ref2/tardis/visualization/tools/tests/test_sdec_plot/test_sdec_plotter ================================================== Summary for test_generate_plot_mpl__plotter_generate_plot_ply12__.h5: Total number of keys- in ref1: 25, in ref2: 25 Number of keys with different names in ref1 and ref2: 0 Number of keys with same name but different data in ref1 and ref2: 1 Number of totally same keys: 24 ==================================================
Testing individual files¶
You can compare individual files too. Below example would work if you used example commits.
# comparer.hdf_comparator.summarise_changes_hdf("test_generate_plot_ply__plotter_generate_plot_ply1__.h5",
# Path(comparer.ref1_path) / "tardis/visualization/tools/tests/test_liv_plot/test_liv_plotter",
# Path(comparer.ref2_path) / "tardis/visualization/tools/tests/test_liv_plot/test_liv_plotter"
# )
HDF File Comparison¶
Below graph visualises all the HDF files that changed. Each block represents a key that changed, hovering on that block would show relative percentage change for that key.
fig_same_name = comparer.generate_graph("different keys same name")
fig_different_keys = comparer.generate_graph("different keys")
Generating graph with updated hovertemplate
Saved plot to comparison_plots_c31d35_new_b2fdf4_old/same_name_diff.png Generating graph with updated hovertemplate
fig_different_keys
fig_same_name.layout.width = 1000
fig_same_name
Spectrum Comparison¶
You can compare TARDIS spectra for the two commits and also provide a custom path for the spectra.
comparer.compare_testspectrumsolver_hdf(
custom_ref1_path=Path(comparer.ref1_path) / custom_ref1_spectrum_path,
custom_ref2_path=Path(comparer.ref2_path) / custom_ref2_spectrum_path
)
/home/runner/work/tardis/tardis/tardis-regression-data/compare.py:332: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
Saved spectrum plot to comparison_plots_c31d35_new_b2fdf4_old/spectrum.png
comparer.teardown()
Removed temporary directory /tmp/ref_compare_lfl0odub